package com.heima.admin.controller.v1;

import com.heima.admin.service.AdUserService;
import com.heima.model.admin.dtos.UserDTO;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "运营平台登录API", tags = "运营平台登录API")
@RestController
@RequestMapping("/login")
public class AdUserController {
    @Autowired
    AdUserService service;

    @ApiOperation(value = "登录", notes = "1.检查用户是否存在 2.检查密码是否正确 3.检查用户状态是否有效 4.修改最近登录时间 5.颁发token")
    @PostMapping("/in")
    public ResponseResult login(@RequestBody UserDTO dto){
        return service.login(dto);
    }
}
